<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <jsp:include page="../header.jsp"></jsp:include>
</head>

<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <a class="mui-icon mui-icon-plusempty mui-pull-right"
       href="${pageContext.request.contextPath}/distributor/manager/add"><h4></h4></a>
    <h1 class="mui-title">
        <c:choose>
            <c:when test="${level eq 2}">
                二级代理商
            </c:when>
            <c:otherwise>
                三级代理商
            </c:otherwise>
        </c:choose>

    </h1>
</header>
<jsp:include page="../commonMenu.jsp"></jsp:include>
<div class="mui-content">
    <ul class="mui-table-view">
        <c:forEach items="${distributorList}" var="vo">
            <li class="mui-table-view-cell mui-collapse">
                <a class="mui-navigate-right" href="#">
                    <span class="mui-pull-left">${vo.name}</span>
                    <span class="mui-pull-right">${vo.onlineCount}/${vo.allCount}</span>
                </a>
                <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed">
                    <c:forEach items="${vo.devInfoList}" var="subVo">
                        <a href="${pageContext.request.contextPath}/distributor/devInfo/detail/${subVo.id}">
                            <li class="mui-table-view-cell">
                                <div class="mui-slider-cell">
                                    <div class="oa-contact-cell mui-table">
                                        <div class="oa-contact-avatar mui-table-cell">
                                            <img src="${pageContext.request.contextPath}/static/img/51.png"/>
                                        </div>
                                        <div class="oa-contact-content mui-table-cell">
                                            <div class="mui-clearfix">
                                                <h4 class="oa-contact-name">设备ID:${subVo.id}</h4>
                                                <span class="oa-contact-position mui-h6 mui-btn-danger">
                                    <c:choose>
                                        <c:when test="${subVo.devStatus eq 1}">
                                            正常
                                        </c:when>
                                        <c:when test="${subVo.devStatus eq 2}">
                                            欠费
                                        </c:when>
                                        <c:when test="${subVo.devStatus eq 3}">
                                            待激活
                                        </c:when>
                                        <c:when test="${subVo.devStatus eq 4}">
                                            关机
                                        </c:when>
                                        <c:when test="${subVo.devStatus eq 5}">
                                            漏水
                                        </c:when>
                                        <c:when test="${subVo.devStatus eq 6}">
                                            缺水
                                        </c:when>
                                        <c:when test="${subVo.devStatus eq 7}">
                                            检修
                                        </c:when>
                                        <c:when test="${subVo.devStatus eq 8}">
                                            更换滤芯
                                        </c:when>
                                        <c:otherwise>
                                            未知
                                        </c:otherwise>
                                    </c:choose>
                                </span>
                                            </div>
                                            <p class="oa-contact-email mui-h6">
                                                <fmt:formatDate value="${subVo.createTime}"
                                                                pattern="yyyy-MM-dd HH:mm:ss"/>
                                            </p>
                                        </div>
                                    </div>
                                </div>
                            </li>
                        </a>
                    </c:forEach>
                </ul>
            </li>
        </c:forEach>
    </ul>

</div>

</body>
<jsp:include page="../footer.jsp"></jsp:include>
<script src="${pageContext.request.contextPath}/static/mui/js/echarts-all.js"></script>

</html>